package br.edu.infnet.hibernate.util;

import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

import br.edu.infnet.dao.AlunoDao;
import br.edu.infnet.dao.ModuloDAO;
import br.edu.infnet.modelo.Aluno;
import br.edu.infnet.modelo.Modulo;

public class Main {
	
	public static void main(String args[]){

		Configuration cfg = new Configuration().configure();
		SchemaExport schema = new SchemaExport(cfg);
		schema.create(true,true);
		inserirAlunos();
		inserirModulos();
		
	}
	
	private static void inserirAlunos(){
		AlunoDao ub = new AlunoDao();
		ub.inserir(new Aluno("admin","admin","admin","123"));
		ub.inserir(new Aluno("teste","teste","teste","456"));
		ub.inserir(new Aluno("thiago","thiago","thiago","789"));
	}
	private static void inserirModulos(){
		ModuloDAO md = new ModuloDAO();
		md.incluir(new Modulo("Java Desktop"));
		md.incluir(new Modulo("Java Web"));
		md.incluir(new Modulo("Engenharia de software"));
	}
	
}
